package com.hnas.common.service.mapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.hnas.common.orm.SysLogInfo;
import com.hnas.common.service.dto.DTOLogInfo;
import com.hnas.core.mapper.Mapper;

public class LogInfoMapper extends Mapper<DTOLogInfo, SysLogInfo> {
	private static LogInfoMapper mapper;
	private LogInfoMapper(){
		super(DTOLogInfo.class,SysLogInfo.class);
	}
	public static LogInfoMapper getInstance(){
		if(mapper == null){
			mapper = new LogInfoMapper();
		}
		return mapper;
	}
	public DTOLogInfo mapToValue(SysLogInfo vo){
		if(vo == null) return null;
		DTOLogInfo dto = new DTOLogInfo();
		BeanUtils.copyProperties(vo, dto);
		return dto;
	}
	public List<DTOLogInfo> mapToValue(List<SysLogInfo> list){
		if(list == null) return null;
		List<DTOLogInfo> dtoList = new ArrayList<DTOLogInfo>();
		for(SysLogInfo vo : list){
			dtoList.add(mapToValue(vo));
		}
		return dtoList;
	}
}
